package dem1;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-05-21
 * Time: 16:01
 */
import java.util.Scanner;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()){
            String str = in.nextLine();
            str  = Dev(str);
            System.out.println(str);
        }
    }

    public static String Dev(String str){
        StringBuffer strbuffer = new StringBuffer();
        int flag = 1;
        for(int i = 0; i < str.length() - 1; i++){
            char chcur = str.charAt(i);
            char chnext = str.charAt(i + 1);
            if(chcur != chnext){
                if(flag % 2 == 1){
                    strbuffer.append(chcur);//
                }
                flag = 1;
            }else{
                flag++;
            }
        }
        if (flag == 1){
            strbuffer.append(str.charAt(str.length() - 1));
        }
        return strbuffer.toString();
    }
}
